<template>
	<view class="s_wp">
		<view class="search" @click="$navTo('../searchgoodlist/searchgoodlist')">
			<text class="yticon icon-sousuo" :style="{color:bg}"></text>
			<text class="text">搜索大牌商品</text>
		</view>
<!-- 		<view class="button" @click="kefu">
			<image src="../../static/kef.png" mode=""></image>
			<text>客服</text>
		</view> -->
		<!-- <view class="button" @click="fenlei"> -->
			<!-- <text class="yticon icon-xiaoxi icon"></text> -->
			<!-- <image src="../../static/fenlei.png" mode=""></image>
			<text>分类</text>
		</view> -->
	</view>
</template>

<script>
	export default {
		name: 'tab_search',
		props: {
			bg: {
				type: String,
				default: ''
			}
		},
		methods: {
			fenlei(){
				uni.navigateTo({
					url: '../category/category'
				})
			},
			
			kefu() {
				this.$axios('home/kf', 'POST', 'shop').then(res => {
					if (res.data.code == 200) {
						var href = res.data.data;
						// #ifdef APP-PLUS || MP-WEIXIN
						uni.navigateTo({
							url: "../web/web-view?url=" + href
						})
						// #endif
						// #ifdef H5
						window.location.href = href
						// #endif
					} else {}
				}), (error) => {}

			},
		}
	}
</script>

<style lang="scss">
	@font-face {
		font-family: iconfont;
		font-weight: normal;
		font-style: normal;
		src: url('../../static/iconfont.ttf') format('truetype');
	}

	.iconfont {
		font-family: "iconfont" !important;
		font-size: 16px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	.icon-kefu:before {
		content: "\e769";
	}

	.s_wp {
		// background: linear-gradient($bg-color, #6f04b9);
		background: linear-gradient($bg-color,#7404cd);
		display: flex;
		align-items: center;
		// height: 50upx;
		height: calc(var(--status-bar-height) + 126rpx);
		padding: calc(var(--status-bar-height) + 38rpx) 20rpx 20rpx;
		position: fixed;
		left: 0;
		top: 0;
		display: flex;
		align-items: center;
		width: 100%;
		z-index: 999;
		.search {
			background: #fff;
			border-radius: 50upx;
			display: flex;
			align-items: center;
			// flex: 1;
			padding: 0 20upx;
			height: 70upx;
			width: 500rpx;
			.icon-sousuo {
				font-size: 45upx;
				margin-right: 5upx;
			}

			.text {
				// font-weight: 600;
				color: #666;
				letter-spacing: 1px;
			}
		}

		.button {
			color: #fff;
			display: flex;
			flex-wrap: wrap;
			justify-content: center;
			width: 80upx;
			image{
				height: 50upx;
				width: 50upx;
			}

			text {
				font-size: 22upx;
				text-align: center;
				width: 100%;
			}

			.icon {
				font-size: 50upx;
			}
		}
	}
</style>